import { createApp } from 'vue'
import App from './App.vue'

// pinia
import { createPinia } from 'pinia'
import persistedstate from 'pinia-plugin-persistedstate'
// 路由
import router from './router'
// 添加权限菜单的操作
import "@/router/permissionsRouter.ts";

//elment 
import ElementPlus from 'element-plus'
import './assets/main.css'
import "element-plus/dist/index.css";
import * as Icons from "@element-plus/icons-vue";
// 国际化
import {i18n} from "@/i18n";

// axios封装的方法全局挂载
// import {get,post} from '@/request/http'

// 时间对象重新挂载增加了新方法
import Date from "@/utils/time";

const app = createApp(App)
// 全局挂载
// app.config.globalProperties.$get=get
// app.config.globalProperties.$post=post
//使用
// import {ref,reactive,getCurrentInstance} from 'vue'
// const app = getCurrentInstance()
// console.log(app?.proxy?.$filters.format('js'))

const store=createPinia()
store.use(persistedstate)
app.use(store)
app.use(ElementPlus)
// 注册全部图标组件
Object.keys(Icons).forEach(key => {
    app.component(key, Icons[key as keyof typeof Icons]);
});

app.use(router)
app.use(i18n)
app.mount('#app')
